Conversation
model/model_test.go
Outdated
| } | ||
|
|
||
| // Clear any existing subfeeds. | ||
| store.Delete(ctx, store.NameKey(typeSubFeed, fmt.Sprintf("%d.%d", testSubFeedFeedID, testSubFeedID))) |
There was a problem hiding this comment.
I think you should consider using t.Cleanup for any sort of DB type testing, then you shouldn't need to do this. I also think it might be better to just do a check for any existing stuff, and panic if it's there; we don't expect anything in the file DB for the start of a test right ? Doing this hides any test cleanup issues.
There was a problem hiding this comment.
Would you recommend that the cleanup function deletes the directory directly instead of the entities
There was a problem hiding this comment.
Yes actually. I guess it should get rid of anything that wasn't there before the testing.
| store.Delete(ctx, store.NameKey(typeSubFeed, fmt.Sprintf("%d.%d", testSubFeedFeedID, testSubFeedID+1))) | ||
|
|
||
| startTime := time.Now().UTC().Truncate(0) | ||
| finishTime := startTime.Add(1 * time.Hour) |
There was a problem hiding this comment.
Does 1 hour have any significance, or just arbitrary ?
There was a problem hiding this comment.
This is just an arbitrary time so that they are different (not that it really matters)
There was a problem hiding this comment.
Maybe comment that it's arbitrary
This change adds a subfeed which captures all the information about a short-lived instance of a feed.
13e4904 to
82dda89
Compare
This change adds a cleanup function to remove the entities created by previous test runs.
82dda89 to
2a497ce
Compare
We don't have a version number for model, the only version number that we have for it is the global cloud repo version tag, which I will update once this has been merged. |
Add methods and testing for subfeed methods.